﻿using System;
using System.Windows.Threading;
using WhiteFlow.Wpf.Common.Mvvm.ViewModel;

namespace WhiteFlow.DevTrackingTool.UI.ViewModels
{
    public class SplashViewModel : ViewModelBase, IDisposable
    {
        #region Constants

        /// <summary>
        /// The StatusText property name.
        /// </summary>
        public const string StatusTextPropertyName = "StatusText";

        #endregion

        #region Fields
        
        private string statusText = null;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the status text.
        /// </summary>
        /// <value>
        /// The status text.
        /// </value>
        public string StatusText
        {
            get { return statusText; }
            set
            {
                if (statusText == value)
                    return;

                statusText = value;
                OnPropertyChanged(StatusTextPropertyName);
            }
        }

        public Dispatcher Dispatcher { get; set; }

        #endregion

        #region IDisposable Implementation

        public void Dispose()
        {
            if (Dispatcher != null)
            {
                Dispatcher.InvokeShutdown();
                Dispatcher = null;
            }
        }

        #endregion
    }
}